package com.lhys.mapper;

import com.lhys.pojo.AssetProviderType;
import com.lhys.pojo.AssetProviderType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 资产_供应商_类型表 Mapper 接口
 * </p>
 *
 * @author 小七
 * @since 2021-05-06
 */
public interface AssetProviderTypeMapper {
    @Insert("INSERT INTO asset_provider_type(title) VALUES (#{title})")
    Integer addAssetProviderType(AssetProviderType assetProviderType);

    @Delete("delete from asset_provider_type where id = #{id}")
    Integer delAssetProviderTypeById(Integer id);

    @Delete("delete from asset_provider_type where title = #{title}")
    Integer delAssetProviderTypeByTitle(String title);

    @Update("UPDATE `asset_provider_type` SET `title`= #{title} WHERE (`id`= #{id})")
    Integer updateAssetProviderType(AssetProviderType assetProviderType);

    @Select("select * from asset_provider_type where id = #{id}")
    AssetProviderType getAssetProviderTypeById(Integer id);

    @Select("select * from asset_provider_type where id = #{title}")
    AssetProviderType getAssetProviderTypeByTitle(String title);

    @Select("select * from asset_provider_type")
    List<AssetProviderType> getAssetProviderTypeList();
}
